<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var cities = [];
			cities[0] = ["沈阳","大连","盘锦"];
			cities[1] = ["吉林","长春","四平"]; 
			cities[2] = ["哈尔滨","黑河","漠河"];
			
			function getCity(){
				var province = document.getElementById("province").value;
				
				var city ;
				var option;
				city = document.getElementById("city");
				
				city.options.length = 1;//清空之前的选择
				
				// cities[province-1]
				
				for(i = 0; i <cities[province-1].length;i++ ){
					var option = new Option(cities[province-1][i],i+1);
					city.options.add(option);
				}
				
			// 	if(province == 2){
			// 		option = new Option("吉林",1)
			// 		city.options.add(option);
					
			// 		option = new Option("长春",2)
			// 		city.options.add(option);
					
			// 		option = new Option("四平",3)
			// 		city.options.add(option);
			// 	}else if(province == 1){
			// 		option = new Option("沈阳",1)
			// 		city.options.add(option);
					
			// 		option = new Option("大连",2)
			// 		city.options.add(option);
					
			// 		option = new Option("盘锦",3)
			// 		city.options.add(option);
			// 	}else if(province == 3){
			// 		option = new Option("哈尔滨",1)
			// 		city.options.add(option);
					
			// 		option = new Option("黑河",2)
			// 		city.options.add(option);
					
			// 		option = new Option("漠河",3)
			// 		city.options.add(option);
			// 	}
			}
		</script>
	</head>
	<body>
		省份:
		<select id="province" onchange="getCity()">
			<option value="0">请选择</option>
			<option value="1">辽宁</option>
			<option value="2">吉林</option>
			<option value="3">黑龙江</option>
		</select>
		城市:
		<select id="city">
			<option value ="0">请选择</option>
		</select>
	</body>
</html>
